package main

import (
	many_one "app/many-one"
	"app/out"
	"os"
	"os/signal"
	"syscall"
)

func main() {
	o := out.NewOut()
	//消费者
	go o.OutPut()

	//生产者
	out.Input("ABC")
	out.Input("DEF")
	out.Input("HIJ")
	out.Input("KLM")

	//one_one.Exec()

	//one_many.Exec()

	many_one.Exec()

	//除非接收到终止信号，否则一直阻塞
	sign := make(chan os.Signal)
	signal.Notify(sign, syscall.SIGTERM, syscall.SIGTERM)
	<-sign
}
